#ifndef WF_DRAWLINEPARALLELTHROUGH_H
#define WF_DRAWLINEPARALLELTHROUGH_H

#include "pf_previewactioninterface.h"
#include "gui_export.h"

/**
 * This action class can handle user events to draw parallel 
 * lines, arcs and circles.
 *
 */
class GUI_EXPORT WF_DrawLineParallelThrough : public PF_PreviewActionInterface {
	Q_OBJECT
private:
    enum Status {
        SetEntity,    /**< Choose original entity. */
		SetPos,       /**< Setting point for this parallel to go through. */
		SetNumber     /**< Setting number in the command line. */
	};
	
public:
    WF_DrawLineParallelThrough(PF_Container& container,
                              PF_GraphicView& graphicView);
    ~WF_DrawLineParallelThrough() {}

	static QAction* createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/);
	
	virtual LX_Define::ActionType rtti() {
		return LX_Define::ActionDrawLineParallelThrough;
	}

    virtual void trigger();
	
    virtual void mouseMoveEvent(PF_MouseEvent* e);
    virtual void mouseReleaseEvent(PF_MouseEvent* e);
    virtual void updateMouseButtonHints();
	
	virtual void coordinateEvent(PF_CoordinateEvent* e);
    virtual void commandEvent(PF_CommandEvent* e);
	virtual PF_StringList getAvailableCommands();
	
    virtual void hideOptions();
    virtual void showOptions();

    virtual void updateMouseCursor();
    virtual void updateToolBar();

	int getNumber() {
		return number;
	}

	void setNumber(int n) {
		number = n;
	}

private:
    /** Closest parallel. */
    PF_Entity* parallel;
    /** Data of new line */
    PF_LineAttribute data;
	/** Number of parallels. */
	int number;
	/** Coordinate of the mouse. */
	PF_Vector coord;
	/** Original entity. */
	PF_Entity* entity;
	/** Last status before entering length or number. */
	Status lastStatus;
	/**
	 * Commands
	 */
	/*
	PF_String cmdDistance;
	PF_String cmdDistance2;
	PF_String cmdDistance3;
	
	PF_String cmdNumber;
	PF_String cmdNumber2;
	PF_String cmdNumber3;
	*/
};

#endif
